package com.sinoglobal.shakeprize.activity.prize;

import java.util.List;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;

import com.sinoglobal.shakeprize.R;
import com.sinoglobal.shakeprize.activity.base.AbstractActivity;
import com.sinoglobal.shakeprize.adapter.PrizeListAdapter;
import com.sinoglobal.shakeprize.bean.PrizeListParamerItem;

/**
 * @author temulu
 * @createdate 2015-8-26下午2:38:22
 * @Description 即将过期的未领取奖品界面
 */
public class MyPrizeWillExpireActivity extends AbstractActivity {

	private ListView prizeListView;
	private List<PrizeListParamerItem> willExpireList;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.prize_mine_activity);
		titleView.setText("即将过期");
		prizeListView = (ListView) findViewById(R.id.prizeList);
		initData();
	}

	private void initData() {
		willExpireList=getIntent().getParcelableArrayListExtra("willExpireList");
		PrizeListAdapter adapter=new PrizeListAdapter(this,willExpireList);
		adapter.setShowPrizeMineListItemExpire(true);
		prizeListView.setAdapter(adapter);
		prizeListView.setOnItemClickListener(new OnItemClickListener() {

			@Override
			public void onItemClick(AdapterView<?> parent, View view,
					int position, long id) {
				Intent intent=new Intent(MyPrizeWillExpireActivity.this,
						MyPrizeDetailsActivity.class);
				intent.putExtra("accepttype",
						willExpireList.get(position).accepttype);
				intent.putExtra("userprizeId", willExpireList.get(position).userprizeid);
				intent.putExtra("prizeId", willExpireList.get(position).prizeid);
				intent.putExtra("pickstatus", willExpireList.get(position).pickstatus);
				intent.putExtra("roundid", willExpireList.get(position).roundid);
				startActivity(intent);
			}
		});
	}

	@Override
	protected void onDestroy() {
		super.onDestroy();
	}
}
